package com.dnjn.happiness.emo.api;

import com.dnjn.happiness.common.core.constant.SecurityConstants;
import com.dnjn.happiness.common.core.constant.ServiceNameConstants;
import com.dnjn.happiness.common.core.domain.R;
import com.dnjn.happiness.common.core.model.HxBeanSeed;
import com.dnjn.happiness.emo.api.domain.EmoAvgScoreDaily;
import com.dnjn.happiness.emo.api.factory.RemoteEmoAvgScoreDailyFallbackFactory;
import com.dnjn.happiness.emo.api.factory.RemoteEmoUserFallbackFactory;
import com.dnjn.happiness.emo.api.model.EmoUserBean;
import com.dnjn.happiness.emo.api.model.EmoUserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDate;
import java.util.List;

@FeignClient(contextId = "remoteEmoAvgScoreDailyService", value = ServiceNameConstants.EMO_SERVICE, fallbackFactory = RemoteEmoAvgScoreDailyFallbackFactory.class)
public interface RemoteEmoAvgScoreDailyService {

    @GetMapping("/admin/score/daily/updateDaily/{userId}/{happinessScores}/{time}")
    void updateDaily(@PathVariable("userid") Long userId,@PathVariable("happinessScores") Integer happinessScores,@PathVariable("time") String time,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);


    @GetMapping("/admin/score/daily/getEmoAvgScoreDailyByUserIdAndDate")
    R<EmoAvgScoreDaily> getEmoAvgScoreDailyByUserIdAndDate(@RequestParam("userid") Long userId, @RequestParam("localDate") LocalDate localDate, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
